package org.arabidopsis.plantCyc;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * ECnumber class to have ECnumber of the format 1.1.1.1
 * checks if correctly formatted at construction time. 
 */
public class ECnumber {
	String fourNumbers;
	static Pattern ecNumberPattern =
		Pattern.compile("((\\d)+.){3}(\\d)+");
	
	ECnumber(String fourNumbersParam) {
		Matcher matcher =ecNumberPattern.matcher(fourNumbersParam);
		if (!matcher.find())
			System.out.println("ERROR: ecNumber pattern erroneous");
		fourNumbers=matcher.group();
	}
	
	//public String extract(String line){
		
	//}
    public String toString() {
    	return fourNumbers; 
    }

}
